package com.vvlive.caibao.smartcity.utils;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;
import android.support.v7.app.AlertDialog;

/**
 * Created by zhj on 2015/10/22.
 */
public class DialogUtil {

    public static void showItemsDialog(Context context, String title, String[] items, OnClickListener clickListener){
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(title).setItems(items, clickListener).create().show();
    }

    public static void showAlertDialog(Context context, String title, String message){
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(title).setMessage(message).create().show();
    }

    public static ProgressDialog showProgressDialog(Context context, String title, String message){
        return ProgressDialog.show(context, title, message);
    }

    public static void showDialog(Context context, String title, String message, OnClickListener clickListener){
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setPositiveButton("确定", clickListener).setNegativeButton("取消", clickListener).setTitle(title)
                .setMessage(message).show();
    }
}
